package com.example.teamilkmall.service.Impl;

import com.example.teamilkmall.entity.OrdersInfo;
import com.example.teamilkmall.mapper.OrdersInfoMapper;
import com.example.teamilkmall.service.OrdersInfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrdersInfoServiceImpl implements OrdersInfoService {

    private final OrdersInfoMapper ordersInfoMapper;

    public OrdersInfoServiceImpl(OrdersInfoMapper ordersInfoMapper) {
        this.ordersInfoMapper = ordersInfoMapper;
    }


    @Override
    public PageInfo<OrdersInfo> listOrdersInfo(Integer pageSize, Integer pageNum, Integer id) {
        List<OrdersInfo> list =ordersInfoMapper.listOrdersInfo(pageNum,pageNum,id);
        PageInfo<OrdersInfo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public void updateOrdersInfo(OrdersInfo ordersInfo) {
        ordersInfoMapper.updateOrdersInfo(ordersInfo);
    }

    @Override
    public void deloneOrdersInfo(Integer id) {
        ordersInfoMapper.deloneOrdersInfo(id);
    }

    @Override
    public void addOrdersInfo(OrdersInfo ordersInfo) {
        ordersInfoMapper.addOrdersInfo(ordersInfo);
    }

    @Override
    public List<OrdersInfo> listOrdersinfo() {
        return ordersInfoMapper.getListOrdersInfo();
    }
}

